class testClass extends Tile
{
	constructor()
	{
		Tile.constructor("test.jpg")
		setX(100);
		setY(200);
		local origin = Vector2f()
		origin.x=90
		origin.y=70
		setCenter(origin)
		print("testclass created")
	}
	
	function onSave(out)
	{
		print("saving testClass")
		return
	}
	
	function update()
	{
		setRotation(getRotation()+0.6)
		//getActiveCamera().setPosition(getPosition())
	}
}
//Text().setText("shit")
test<-testClass()

class fps extends Text
{
	constructor()
	{
		Text.constructor()
		local origin=Vector2f()
		origin.x=90
		origin.y=70
		setCenter(origin)
	}
	function update()
	{
			local text="FPS:"
			local fps=1/getFrameTime();
			text=text+fps.tostring();
			setText(text)
			position.x=mouseX()
			position.y=mouseY()
			setPosition(position)
	}
	function onKey()
	{
		setText("Hi ")
	}
	position=Vector2f()
}
fps()
class aThingThatHasHP extends Text
{
	function onSave(out)
	{
		print("Saving my current HP: 100")
		out.HP<-100
	}
	
	function onLoad(input)
	{
		print("Loading my HP:"+input.HP)
	}
}
//aThingThatHasHP()
//test<-fps()

class Suicide extends Text
{
	function update()
	{
		remove()
		print("Bye bye everyone")
	}
}
//Suicide()

function pressA()
{
 print("you pressed A")
 getCurrentMap().save("testMap.map")
}
function releaseA()
{
	print("you released A")
}

function loadState()
{
	print("loading")
	local map=loadMap("testMap.map")
	if(map)
	{
		switchMap(map)
	}
}

function mouse1()
{
	print("mouse1")
}
function changeMode()
{
  setEditMode(true)
}
mapInput("MLeft",mouse1)
mapInput("A",pressA,releaseA)
mapInput("Escape",null,endGame)
mapInput("B",loadState)
mapInput("F2",changeMode)

profile<-AnimationProfile({
width=16
height=32
yOffset=0
xOffset=0
xGap=1
yGap=1
numFrame=4
numFrameInRow=4
})
//AnimatedSprite("BombermanDS.png",profile,0.02)
mount("ModPackage.zip","/",true)//mount the mod script
dofile("Mod/config.nut")
